<?php
/**
 * Created by PhpStorm.
 * User: fengzi
 * Date: 2019/5/29
 * Time: 17:18
 */

namespace app\vehicle\model;
use think\Model;

class Volunteer extends Model
{
    public function getStatusAttr($value){
        $arr = ['审核中','审核通过','审核不通过'];
        return $arr[$value];
    }

    public function user(){
        return $this->hasOne('user', 'id', 'user_id')->bind([
            'nickname'=>'nick_name',
            'duration'=>'duration',
            'duration1'=>'duration1'
        ]);
    }

    public function siteName(){
        return $this->hasOne('site', 'id', 'site_id')->bind([
            'site'=>'name'
        ]);
    }

    public function teams(){
        return $this->hasOne('site_team', 'id', 'oid')->bind([
            'team'=>'name'
        ]);
    }
}